package com.atguigu.gmallsuger.mapper;

import com.atguigu.gmallsuger.bean.ProvinceStats;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/7/7 14:04
 */
public interface ProvinceStatsMapper {
    @Select("SELECT\n" +
        "    province_name,\n" +
        "    sum(order_amount) AS order_amount,\n" +
        "    sum(order_count) AS order_count\n" +
        "FROM province_stats_2021\n" +
        "WHERE toYYYYMMDD(stt) = #{date}\n" +
        "GROUP BY province_name")
    List<ProvinceStats> getProvinceStatsByProvinceName(int date);
    
}
